import request from '@/utils/request'
// 企业列表
export function getEnterpriseList (params) {
  return request({
    url: '/park/enterprise',
    params
  })
}
// 获取企业详情
export function getIndustry () {
  return request({
    url: '/park/industry'
  })
}
// 上传图片
export function uploadAPI (data) {
  return request({
    url: '/upload',
    method: 'POST',
    data
  })
}
// 新增企业
export function addEnterprise (data) {
  return request({
    url: '/park/enterprise',
    method: 'POST',
    data
  })
}
/**
 * 获取合同详情
 * @param {*} id
 * @returns
 */
export function getEnterpriseDetailAPI (id) {
  return request({
    url: `/park/enterprise/${id}`
  })
}
// 编辑
export function updateEnterprise (data) {
  return request({
    url: '/park/enterprise',
    method: 'PUT',
    data
  })
}
// 删除
export function delEnterprise (id) {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'DELETE'
  })
}
// 获取楼宇列表
export function getBuildingList () {
  return request({
    url: '/park/rent/building'
  })
}
// 创建合同
export function createContract (data) {
  return request({
    url: '/park/enterprise/rent',
    method: 'POST',
    data
  })
}
/**
 * 获取合同列表
 * @param {*} id
 * @returns
 */
export function getRentListAPI (id) {
  return request({
    url: `/park/enterprise/rent/${id}`
  })
}
// 合同退组状态修改
export function outRentApi (rentId) {
  return request({
    url: `/park/enterprise/rent/${rentId}`,
    method: 'PUT'
  })
}
// 获取详情

export function getEnterpriseDetail (id) {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'GET'
  })
}
